import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:magic_car/user/draw.dart';
import 'package:magic_car/util/HttpHelper.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:toast/toast.dart';
import 'package:fluwx/fluwx.dart' as fluwx;

class AcountPage extends StatefulWidget {
  AcountPage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => new _MyHomePageState();
}

class _MyHomePageState extends State<AcountPage> {
  Map acountinfo = new Map();
  int withdraw_type = 1;
  Map userinfo = new Map();
  @override
  void initState() {
    super.initState();
    fluwx.weChatResponseEventHandler.listen((res) {
      //print(res.code);
      if (res is fluwx.WeChatAuthResponse) {
        if (res.code == "") {
          Toast.show('授权失败！', context);
        } else
          getwxinfo(res.code);
      }
    });
    loaddata(); //页面展示时加载数据
    loaduserinfo();
  }

  getwxinfo(code) async {
    Map<String, String> map = new Map();
    SharedPreferences pref = await SharedPreferences.getInstance();
    map["uid"] = pref.getString('uid');
    map['code'] = code;
    // map['ispartner']='1';
    String role = pref.getString('role');
    if (role == "0") {
      map["issite"] = "1";
    } else {
      map["ispartner"] = '1';
    }
    print(map);

    HttpHelper.post(HttpHelper.API_GetWxInfo, (data) async {
      if (data != null) {
        print(data);
        Toast.show(data['msg'], context);
        if (data['code'].toString() == "1") {
          //授权成功，发起提现申请
          applydraw();
        }
      }
    }, params: map);
  }

  loaduserinfo() async {
    SharedPreferences pref = await SharedPreferences.getInstance();
    Map<String, String> map = new Map();
    map["id"] = pref.getString('uid');
    // map["type"] = '1';
    String role = pref.getString('role');
    if (role == "0") {
      map["type"] = "0";
    } else {
      map["type"] = '1';
    }
    HttpHelper.post(HttpHelper.API_Userinfo, (data) async {
      if (data != null) {
        print(data);
        //Toast.show(data["msg"], context);

        if (data["code"].toString() == "1") {
          setState(() {
            userinfo = data["info"];
          });
        }
      }
    }, params: map);
  }

  //加载数据
  loaddata() async {
    Map<String, String> map = new Map();
    SharedPreferences pref = await SharedPreferences.getInstance();
    String role = pref.getString('role');
    if (role == "0") {
      map["issite"] = "1";
    } else {
      map["ispartner"] = '1';
    }
    map["id"] = pref.getString('uid');

    print(map);

    HttpHelper.post(HttpHelper.API_GetIncome, (data) async {
      if (data != null) {
        if (data["code"].toString() == "1") {
          print(data);
          print(data["info"].length.toString());
          if (data["code"].toString() == "1") {
            setState(() {
              acountinfo = data["info"];
            });
          }
        } else {}
      }
    }, params: map);
  }

  applydraw() async {
    Map<String, String> map = new Map();
    SharedPreferences pref = await SharedPreferences.getInstance();
    map["id"] = pref.getString('uid');
    // map['role'] = '2';
    map['is_wx'] = '1';
    map['income_type'] = withdraw_type.toString();
    String role = pref.getString('role');
    if (role == "0") {
      map['role'] = '3';
    } else {
      map['role'] = '1';
    }
    // map["name"] = name;
    // map["mobile"] = mobile;
    // map["account"] = acount;
    // map["money"] = money;
    // map["bankname"]=banckName;
    print(map);

    HttpHelper.post(HttpHelper.API_ApplyTx, (data) async {
      //loadpage.close();
      if (data != null) {
        print(data);

        if (data["code"].toString() == "1") {
          Toast.show(data['info'], context);
          Navigator.pop(context);
        } else {
          Toast.show(data['msg'], context);
        }
      }
    }, params: map);
  }

  showAlert(type) {
    showModalBottomSheet(
        context: context,
        builder: (BuildContext context) {
          return Padding(
              padding: new EdgeInsets.fromLTRB(0, 0, 0, 0),
              child: Container(
                height: type == 1 ? 160 : 120,
                child: new Column(children: <Widget>[
                  new Container(
                      decoration: new BoxDecoration(
                          border: Border(
                              bottom: BorderSide(
                                  width: 1, color: Color(0xffe5e5e5)))),
                      height: 50,
                      child: Center(
                          child: Text('是否使用微信作为提现账号！',
                              style: TextStyle(fontSize: 16)))),
                  new Container(
                      height: 30,
                      child: Center(
                          child: Text('为了保障账户安全，请使用您自己的微信进行授权！',
                              style: TextStyle(
                                  fontSize: 12, color: Colors.black)))),
                  new Container(
                      decoration: new BoxDecoration(
                          border: Border(
                              bottom: BorderSide(
                                  width: 1, color: Color(0xffe5e5e5)))),
                      height: 40,
                      child: new GestureDetector(
                          behavior: HitTestBehavior.opaque,
                          onTap: () async {
                            Navigator.pop(context);
                            if (userinfo['app_open_id'] != null) {
                              applydraw();
                            } else {
                              fluwx
                                  .sendWeChatAuth(
                                      scope: "snsapi_userinfo",
                                      state: "wechat_sdk_demo_test")
                                  .then((data) {
                                setState(() {
                                  print("拉取微信用户信息：" + data.toString());
                                });
                              }).catchError((e) {
                                print('weChatLogin  e  $e');
                              });
                            }
                          },
                          child: Center(
                              child: Text('使用微信',
                                  style: TextStyle(
                                      fontSize: 16, color: Colors.red))))),
                  type == 1
                      ? new Container(
                          height: 40,
                          child: new GestureDetector(
                              behavior: HitTestBehavior.opaque,
                              onTap: () {
                                Navigator.pop(context);
                                Navigator.of(context)
                                    .push(new MaterialPageRoute(builder: (_) {
                                  return new DrawPage(withdraw_type.toString());
                                })).then((param) {});
                                // Navigator.pushNamed(context, "draw");
                              },
                              child: Center(
                                  child: Text('使用其他收款方式',
                                      style: TextStyle(fontSize: 16)))))
                      : new Container(height: 0),
                ]),
              ));
        });
  }
  // Widget build(BuildContext context) {
  //   return new Scaffold(
  //       appBar: new AppBar(
  //         title: new Text(
  //           '我的账户',
  //           style: TextStyle(color: Colors.black),
  //         ),
  //         backgroundColor: Colors.white,
  //         elevation: 0,
  //         iconTheme: IconThemeData(
  //           color: Colors.black, //修改颜色
  //         ),
  //       ),
  //       body: new Container(
  //         color: Color.fromRGBO(239, 239, 239, 1),
  //         child: new ListView(
  //           children: <Widget>[
  //             new Padding(
  //               padding: new EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 15.0),
  //               child: new Column(
  //                 children: <Widget>[
  //                   new Container(
  //                       color: Colors.white,
  //                       child: new Column(children: <Widget>[
  //                         new Padding(
  //                           padding:
  //                               new EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 10.0),
  //                           child: new Center(
  //                             child: new Text(
  //                               '可提余额',
  //                               style: TextStyle(fontSize: 15),
  //                             ),
  //                           ),
  //                         ),
  //                         new Padding(
  //                           padding:
  //                               new EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 30.0),
  //                           child: new Center(
  //                             child: new Text(
  //                               acountinfo.containsKey('canWithdrawM')
  //                                   ? acountinfo["canWithdrawM"].toString()
  //                                   : "0.00",
  //                               style: TextStyle(fontSize: 24),
  //                             ),
  //                           ),
  //                         ),
  //                         new Container(
  //                           height: 1,
  //                           color: Color.fromRGBO(239, 239, 239, 1),
  //                         ),
  //                         new Padding(
  //                           padding:
  //                               new EdgeInsets.fromLTRB(0.0, 20.0, 0.0, 10.0),
  //                           child: new Center(
  //                             child: new Text(
  //                               '总收益',
  //                               style: TextStyle(fontSize: 15),
  //                             ),
  //                           ),
  //                         ),
  //                         new Padding(
  //                           padding:
  //                               new EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 30.0),
  //                           child: new Center(
  //                             child: new Text(
  //                               acountinfo.containsKey('total')
  //                                   ? acountinfo["total"].toString()
  //                                   : "0.00",
  //                               style: TextStyle(
  //                                   fontSize: 24, fontWeight: FontWeight.w400),
  //                             ),
  //                           ),
  //                         )
  //                       ])),
  //                   new Padding(
  //                       padding:
  //                           new EdgeInsets.fromLTRB(20.0, 50.0, 20.0, 10.0),
  //                       child: new Container(
  //                         width: double.infinity,
  //                         height: 40,

  //                         child: new Material(
  //                           color: Color.fromRGBO(239, 239, 239, 1),
  //                           //INK可以实现装饰容器
  //                           child: new Ink(
  //                             //用ink圆角矩形
  //                             // color: Colors.red,
  //                             decoration: new BoxDecoration(
  //                               //背景
  //                               color: Color.fromRGBO(27, 182, 251, 1),
  //                               //设置四周圆角 角度
  //                               borderRadius:
  //                                   BorderRadius.all(Radius.circular(20.0)),
  //                               //设置四周边框
  //                               border: new Border.all(
  //                                   width: 1,
  //                                   color: Color.fromRGBO(27, 182, 251, 1)),
  //                             ),
  //                             child: new InkWell(
  //                                 //圆角设置,给水波纹也设置同样的圆角
  //                                 //如果这里不设置就会出现矩形的水波纹效果
  //                                 borderRadius: new BorderRadius.circular(15.0),

  //                                 //设置点击事件回调
  //                                 onTap: () {
  //                                   double money = double.parse(
  //                                       acountinfo["canWithdrawM"].toString());
  //                                   if (money < 100) {
  //                                     //可提现余额不足
  //                                     Toast.show('可提现余额不足100', context);
  //                                   } else {
  //                                     //draw
  //                                     Navigator.pushNamed(context, "draw");
  //                                   }
  //                                 },
  //                                 child: Container(
  //                                   //设置 child 居中
  //                                   alignment: Alignment(0, 0),
  //                                   height: 40,
  //                                   width: double.infinity,
  //                                   //color: Color.fromRGBO(27, 182, 251, 1),
  //                                   child: Text(
  //                                     "提现",
  //                                     style: TextStyle(color: Colors.white),
  //                                   ),
  //                                 )),
  //                           ),
  //                         ),
  //                         // child: new RaisedButton(
  //                         //   child: new Text(
  //                         //     '提现',
  //                         //     style: TextStyle(fontSize: 16),
  //                         //   ),
  //                         //   textColor: Colors.white,
  //                         //   color: Color.fromRGBO(27, 182, 251, 1),
  //                         //   onPressed: () {},
  //                         // ),
  //                       )),
  //                   new Padding(
  //                       padding:
  //                           new EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
  //                       child: new Container(
  //                         width: double.infinity,
  //                         height: 40,
  //                         child: new Material(
  //                           color: Color.fromRGBO(239, 239, 239, 1),
  //                           //INK可以实现装饰容器
  //                           child: new Ink(
  //                             //用ink圆角矩形

  //                             decoration: new BoxDecoration(
  //                               //背景
  //                               color: Colors.white,
  //                               //设置四周圆角 角度
  //                               borderRadius:
  //                                   BorderRadius.all(Radius.circular(20.0)),
  //                               //设置四周边框
  //                               border: new Border.all(
  //                                   width: 1,
  //                                   color: Color.fromRGBO(27, 182, 251, 1)),
  //                             ),
  //                             child: new InkWell(
  //                                 //圆角设置,给水波纹也设置同样的圆角
  //                                 //如果这里不设置就会出现矩形的水波纹效果
  //                                 borderRadius: new BorderRadius.circular(15.0),

  //                                 //设置点击事件回调
  //                                 onTap: () {
  //                                   //moneydetail
  //                                   Navigator.pushNamed(context, "moneydetail");
  //                                 },
  //                                 child: Container(
  //                                   //设置 child 居中
  //                                   alignment: Alignment(0, 0),
  //                                   height: 40,
  //                                   width: double.infinity,
  //                                   //color: Color.fromRGBO(27, 182, 251, 1),
  //                                   child: Text(
  //                                     "收益明细",
  //                                     style: TextStyle(
  //                                         color:
  //                                             Color.fromRGBO(27, 182, 251, 1)),
  //                                   ),
  //                                 )),
  //                           ),
  //                         ),
  //                         // child: new RaisedButton(
  //                         //   child: new Text(
  //                         //     '账户明细',
  //                         //     style: TextStyle(fontSize: 16),
  //                         //   ),
  //                         //   textColor: Colors.white,
  //                         //   color: Color.fromRGBO(27, 182, 251, 1),
  //                         //   onPressed: () {},
  //                         // ),
  //                       )),
  //                   Padding(
  //                     padding: new EdgeInsets.fromLTRB(20.0, 50.0, 20.0, 10.0),
  //                     child: new Center(
  //                         child: Text(
  //                       "冻结资金在收益三十天后可提现",
  //                       style: new TextStyle(
  //                           color: Color.fromRGBO(102, 102, 102, 1),
  //                           fontSize: 12),
  //                     )),
  //                   )
  //                 ],
  //               ),
  //             ),
  //           ],
  //         ),
  //       ));
  // }
  Widget build(BuildContext context) {
    return new Scaffold(
        appBar: new AppBar(
          title: new Text(
            '我的账户',
            style: TextStyle(color: Colors.black),
          ),
          backgroundColor: Colors.white,
          elevation: 0,
          iconTheme: IconThemeData(
            color: Colors.black, //修改颜色
          ),
        ),
        body: new Container(
          color: Color.fromRGBO(239, 239, 239, 1),
          child: new ListView(
            children: <Widget>[
              new Padding(
                padding: new EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 15.0),
                child: new Column(
                  children: <Widget>[
                    new Container(
                        color: Colors.white,
                        child: new Column(children: <Widget>[
                          new Row(
                              mainAxisAlignment: MainAxisAlignment.center,
                              crossAxisAlignment: CrossAxisAlignment.center,
                              children: <Widget>[
                                Expanded(
                                    child: new Column(children: <Widget>[
                                      new Padding(
                                        padding: new EdgeInsets.fromLTRB(
                                            0.0, 10.0, 0.0, 10.0),
                                        child: new Center(
                                          child: new Text(
                                            '检测可提余额',
                                            style: TextStyle(fontSize: 15),
                                          ),
                                        ),
                                      ),
                                      new Padding(
                                        padding: new EdgeInsets.fromLTRB(
                                            0.0, 0.0, 0.0, 10.0),
                                        child: new Center(
                                          child: new Text(
                                            acountinfo
                                                    .containsKey('canWithdrawM')
                                                ? acountinfo["canWithdrawM"]
                                                    .toString()
                                                : "0.00",
                                            style: TextStyle(fontSize: 24),
                                          ),
                                        ),
                                      ),
                                      new Padding(
                                          padding: new EdgeInsets.fromLTRB(
                                              0.0, 0.0, 0.0, 20.0),
                                          child: new Container(
                                            width: 80,
                                            height: 35,
                                            child: new Material(
                                              // color: Color.fromRGBO(
                                              //     239, 239, 239, 1),
                                              //INK可以实现装饰容器
                                              child: new Ink(
                                                //用ink圆角矩形
                                                // color: Colors.red,
                                                decoration: new BoxDecoration(
                                                  //背景
                                                  color: Color.fromRGBO(
                                                      27, 182, 251, 1),
                                                  //设置四周圆角 角度
                                                  borderRadius:
                                                      BorderRadius.all(
                                                          Radius.circular(
                                                              20.0)),
                                                  //设置四周边框
                                                  border: new Border.all(
                                                      width: 1,
                                                      color: Color.fromRGBO(
                                                          27, 182, 251, 1)),
                                                ),
                                                child: new InkWell(
                                                    //圆角设置,给水波纹也设置同样的圆角
                                                    //如果这里不设置就会出现矩形的水波纹效果
                                                    borderRadius:
                                                        new BorderRadius
                                                            .circular(15.0),

                                                    //设置点击事件回调
                                                    onTap: () {
                                                      double money = acountinfo[
                                                                  "canWithdrawM"] !=
                                                              null
                                                          ? double.parse(acountinfo[
                                                                  "canWithdrawM"]
                                                              .toString())
                                                          : 0;

                                                      if (double.parse(acountinfo[
                                                              "canWithdrawM"]) ==
                                                          0) {
                                                        //可提现余额不足
                                                        Toast.show(
                                                            '无可提现收益', context);
                                                      } else {
                                                        setState(() {
                                                          withdraw_type = 1;
                                                        });
                                                        Navigator.of(context).push(
                                                            new MaterialPageRoute(
                                                                builder: (_) {
                                                          return new DrawPage(
                                                              withdraw_type
                                                                  .toString());
                                                        })).then((param) {});
                                                        // showAlert(1);
                                                      }
                                                      //
                                                    },
                                                    child: Container(
                                                      //设置 child 居中
                                                      alignment:
                                                          Alignment(0, 0),
                                                      height: 40,
                                                      width: double.infinity,
                                                      //color: Color.fromRGBO(27, 182, 251, 1),
                                                      child: Text(
                                                        "提现",
                                                        style: TextStyle(
                                                            color:
                                                                Colors.white),
                                                      ),
                                                    )),
                                              ),
                                            ),
                                          )),
                                    ]),
                                    flex: 1),
                                Expanded(
                                    child: new Container(
                                      decoration: new BoxDecoration(
                                        border: new Border(
                                            left: BorderSide(
                                                color: Color.fromRGBO(
                                                    239, 239, 239, 1),
                                                width: 1.0)),

                                        // color: Color(0xFF9E9E9E),
                                      ),
                                      child: new Column(children: <Widget>[
                                        new Padding(
                                          padding: new EdgeInsets.fromLTRB(
                                              0.0, 10.0, 0.0, 10.0),
                                          child: new Center(
                                            child: new Text(
                                              '渠道收益余额',
                                              style: TextStyle(fontSize: 15),
                                            ),
                                          ),
                                        ),
                                        new Padding(
                                          padding: new EdgeInsets.fromLTRB(
                                              0.0, 0.0, 0.0, 10.0),
                                          child: new Center(
                                            child: new Text(
                                              acountinfo.containsKey(
                                                      'canWithdraw_qudao')
                                                  ? acountinfo[
                                                          "canWithdraw_qudao"]
                                                      .toString()
                                                  : "0.00",
                                              style: TextStyle(fontSize: 24),
                                            ),
                                          ),
                                        ),
                                        new Padding(
                                            padding: new EdgeInsets.fromLTRB(
                                                0.0, 0.0, 0.0, 20.0),
                                            child: new Container(
                                              width: 80,
                                              height: 35,
                                              child: new Material(
                                                // color: Color.fromRGBO(
                                                //     239, 239, 239, 1),
                                                //INK可以实现装饰容器
                                                child: new Ink(
                                                  //用ink圆角矩形
                                                  // color: Colors.red,
                                                  decoration: new BoxDecoration(
                                                    //背景
                                                    color: Color.fromRGBO(
                                                        27, 182, 251, 1),
                                                    //设置四周圆角 角度
                                                    borderRadius:
                                                        BorderRadius.all(
                                                            Radius.circular(
                                                                20.0)),
                                                    //设置四周边框
                                                    border: new Border.all(
                                                        width: 1,
                                                        color: Color.fromRGBO(
                                                            27, 182, 251, 1)),
                                                  ),
                                                  child: new InkWell(
                                                      //圆角设置,给水波纹也设置同样的圆角
                                                      //如果这里不设置就会出现矩形的水波纹效果
                                                      borderRadius:
                                                          new BorderRadius
                                                              .circular(15.0),

                                                      //设置点击事件回调
                                                      onTap: () {
                                                        double money = acountinfo[
                                                                    "canWithdraw_qudao"] !=
                                                                null
                                                            ? double.parse(
                                                                acountinfo[
                                                                        "canWithdraw_qudao"]
                                                                    .toString())
                                                            : 0;

                                                        if (double.parse(acountinfo[
                                                                "canWithdraw_qudao"]) ==
                                                            0) {
                                                          //可提现余额不足
                                                          Toast.show('无可提现收益',
                                                              context);
                                                        } else {
                                                          setState(() {
                                                            withdraw_type = 2;
                                                          });
                                                          showAlert(2);
                                                        }
                                                        //
                                                      },
                                                      child: Container(
                                                        //设置 child 居中
                                                        alignment:
                                                            Alignment(0, 0),
                                                        height: 40,
                                                        width: double.infinity,
                                                        //color: Color.fromRGBO(27, 182, 251, 1),
                                                        child: Text(
                                                          "提现",
                                                          style: TextStyle(
                                                              color:
                                                                  Colors.white),
                                                        ),
                                                      )),
                                                ),
                                              ),
                                            )),
                                      ]),
                                    ),
                                    flex: 1)
                              ]),
                          new Container(
                            height: 1,
                            color: Color.fromRGBO(239, 239, 239, 1),
                          ),
                          new Padding(
                            padding:
                                new EdgeInsets.fromLTRB(0.0, 20.0, 0.0, 10.0),
                            child: new Center(
                              child: new Text(
                                '总收益',
                                style: TextStyle(fontSize: 15),
                              ),
                            ),
                          ),
                          new Padding(
                            padding:
                                new EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 30.0),
                            child: new Center(
                              child: new Text(
                                acountinfo.containsKey('total') &&
                                        acountinfo["total"] != null
                                    ? acountinfo["total"].toString()
                                    : "0.00",
                                style: TextStyle(
                                    fontSize: 24, fontWeight: FontWeight.w400),
                              ),
                            ),
                          )
                        ])),
                    new Padding(
                        padding:
                            new EdgeInsets.fromLTRB(20.0, 50.0, 20.0, 10.0),
                        child: new Container(
                          width: double.infinity,
                          height: 40,
                          child: new Material(
                            color: Color.fromRGBO(239, 239, 239, 1),
                            //INK可以实现装饰容器
                            child: new Ink(
                              //用ink圆角矩形
                              // color: Colors.red,
                              decoration: new BoxDecoration(
                                //背景
                                color: Color.fromRGBO(239, 107, 89, 1),
                                //设置四周圆角 角度
                                borderRadius:
                                    BorderRadius.all(Radius.circular(20.0)),
                                //设置四周边框
                                border: new Border.all(
                                    width: 1,
                                    color: Color.fromRGBO(239, 107, 89, 1)),
                              ),
                              child: new InkWell(
                                  //圆角设置,给水波纹也设置同样的圆角
                                  //如果这里不设置就会出现矩形的水波纹效果
                                  borderRadius: new BorderRadius.circular(15.0),

                                  //设置点击事件回调
                                  onTap: () {
                                    Navigator.pushNamed(context, "drawrec");
                                    // double money =
                                    //     acountinfo["canWithdrawM"] != null
                                    //         ? double.parse(
                                    //             acountinfo["canWithdrawM"]
                                    //                 .toString())
                                    //         : 0;

                                    // if (double.parse(
                                    //         acountinfo["canWithdrawM"]) <
                                    //     100) {
                                    //   //可提现余额不足
                                    //   Toast.show('可提现余额不足100', context);
                                    // } else {
                                    //   showAlert();
                                    // }
                                    //
                                  },
                                  child: Container(
                                    //设置 child 居中
                                    alignment: Alignment(0, 0),
                                    height: 40,
                                    width: double.infinity,
                                    //color: Color.fromRGBO(27, 182, 251, 1),
                                    child: Text(
                                      "提现记录",
                                      style: TextStyle(color: Colors.white),
                                    ),
                                  )),
                            ),
                          ),
                        )),
                    new Padding(
                        padding:
                            new EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
                        child: new Container(
                          width: double.infinity,
                          height: 40,
                          child: new Material(
                            color: Color.fromRGBO(239, 239, 239, 1),
                            //INK可以实现装饰容器
                            child: new Ink(
                              //用ink圆角矩形

                              decoration: new BoxDecoration(
                                //背景
                                color: Colors.white,
                                //设置四周圆角 角度
                                borderRadius:
                                    BorderRadius.all(Radius.circular(20.0)),
                                //设置四周边框
                                border: new Border.all(
                                    width: 1,
                                    color: Color.fromRGBO(27, 182, 251, 1)),
                              ),
                              child: new InkWell(
                                  //圆角设置,给水波纹也设置同样的圆角
                                  //如果这里不设置就会出现矩形的水波纹效果
                                  borderRadius: new BorderRadius.circular(15.0),

                                  //设置点击事件回调
                                  onTap: () {
                                    //moneydetail
                                    Navigator.pushNamed(context, "moneydetail");
                                  },
                                  child: Container(
                                    //设置 child 居中
                                    alignment: Alignment(0, 0),
                                    height: 40,
                                    width: double.infinity,
                                    //color: Color.fromRGBO(27, 182, 251, 1),
                                    child: Text(
                                      "收益明细",
                                      style: TextStyle(
                                          color:
                                              Color.fromRGBO(27, 182, 251, 1)),
                                    ),
                                  )),
                            ),
                          ),
                          // child: new RaisedButton(
                          //   child: new Text(
                          //     '账户明细',
                          //     style: TextStyle(fontSize: 16),
                          //   ),
                          //   textColor: Colors.white,
                          //   color: Color.fromRGBO(27, 182, 251, 1),
                          //   onPressed: () {},
                          // ),
                        )),
                    Padding(
                      padding: new EdgeInsets.fromLTRB(20.0, 50.0, 20.0, 10.0),
                      child: new Center(
                          child: Text(
                        "每次提现为全额提现，交易检测收益每月最多可提现三次",
                        style: new TextStyle(
                            color: Color.fromRGBO(102, 102, 102, 1),
                            fontSize: 12),
                      )),
                    )
                  ],
                ),
              ),
            ],
          ),
        ));
  }
}
